/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author MANUEL
 */
@Entity
@Table(name = "TIPO_SERVICIO")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TipoServicio.findAll", query = "SELECT t FROM TipoServicio t"),
    @NamedQuery(name = "TipoServicio.findByNumTipo", query = "SELECT t FROM TipoServicio t WHERE t.numTipo = :numTipo"),
    @NamedQuery(name = "TipoServicio.findByTipoServicio", query = "SELECT t FROM TipoServicio t WHERE t.tipoServicio = :tipoServicio")})
public class TipoServicio implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "NUM_TIPO")
    private Integer numTipo;
    @Column(name = "TIPO_SERVICIO")
    private String tipoServicio;
    @JoinColumn(name = "NUM_AREA", referencedColumnName = "NUM_AREA")
    @ManyToOne
    private Area numArea;

    public TipoServicio() {
    }

    public TipoServicio(Integer numTipo) {
        this.numTipo = numTipo;
    }

    public Integer getNumTipo() {
        return numTipo;
    }

    public void setNumTipo(Integer numTipo) {
        this.numTipo = numTipo;
    }

    public String getTipoServicio() {
        return tipoServicio;
    }

    public void setTipoServicio(String tipoServicio) {
        this.tipoServicio = tipoServicio;
    }

    public Area getNumArea() {
        return numArea;
    }

    public void setNumArea(Area numArea) {
        this.numArea = numArea;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (numTipo != null ? numTipo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TipoServicio)) {
            return false;
        }
        TipoServicio other = (TipoServicio) object;
        if ((this.numTipo == null && other.numTipo != null) || (this.numTipo != null && !this.numTipo.equals(other.numTipo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "modelo.TipoServicio[ numTipo=" + numTipo + " ]";
    }
    
}
